package itheima.zuoye.test6;
import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        List<SUV> suvList = new ArrayList<>();

        suvList.add(new SUV("丰田RAV4", 4600, 20.5));
        suvList.add(new SUV("大众途观L", 4712, 22.0));
        suvList.add(new SUV("奔驰GLA", 4417, 31.4));
        suvList.add(new SUV("宝马X7", 5163, 100.0));

        System.out.println("中型SUV列表：");
        for (SUV suv : suvList) {
            if ("中型SUV".equals(suv.getType())) {
                System.out.println("品牌：" + suv.getBrand() +
                        "，车长：" + suv.getLength() +
                        "，价格：" + suv.getPrice() + "万");
            }
        }


    }
}
